package com.example.basemvp.net;

import java.io.IOException;

import okhttp3.Interceptor;
import okhttp3.Request;

public class CloudImp implements ICloud{

    private final SHCloudApi userApi;

    public CloudImp() {
        userApi = DataFactory.getCloudUserApi(new Interceptor() {
            @Override
            public okhttp3.Response intercept(Chain chain) throws IOException {
                try {
                    Request request = chain.request();
                    String userToken = request.header("sds_user_token");

                    Request newRequest = null;
//                    newRequest = request.newBuilder()
//                            .addHeader("User-Dev", devInfo)
//                            .addHeader("Dev-Fingerprint", clientId)
//                            .build();

                    okhttp3.Response response = chain.proceed(newRequest);
                    if (response.code() == 401) {
                    }
                    return response;
                } catch (IOException e) {
                    throw e;
                }
            }
        });
    }

}
